//
//  NewOneTableViewCell.m
//  XWZ_News_Work
//
//  Created by dllo on 16/1/17.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "NewOneTableViewCell.h"

@implementation NewOneTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).with.offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-10);
        make.left.equalTo(self.contentView.mas_left).with.offset(10);
        make.width.mas_equalTo(@100);
        
        
    }];
    
    
    [self.labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.image.mas_right).offset(10);
        make.top.equalTo(self.image.mas_top).offset(10);
        make.right.equalTo(self.contentView).offset(-5);
        make.height.equalTo(@(15 * SIZE));
        
    }];

    [self.labelSubject mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.equalTo(self.labelTitle);
        make.top.equalTo(self.labelTitle.mas_bottom).offset(5);
        make.height.equalTo(@(50 * SIZE));
        
    }];

    
    
}

- (void)createSubView
{
    self.backgroundColor = [UIColor whiteColor];
    
    self.image = [[UIImageView alloc] init];
    self.image.image = [UIImage imageNamed:@"lol-tupian"];
    [self.contentView addSubview:self.image];
    
    
    self.labelSubject = [[UILabel alloc] init];
    self.labelSubject.text = @"网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻网易新闻";
    self.labelSubject.font = [UIFont systemFontOfSize:14.0];
    self.labelSubject.numberOfLines = 2;
    [self.contentView addSubview:self.labelSubject];
    
    
    
    
    self.labelTitle = [[UILabel alloc] init];
    self.labelTitle.text = @"网易新闻网易新闻";
    self.labelTitle.font = [UIFont systemFontOfSize:16.0];
    [self.contentView addSubview:self.labelTitle];
    
    
    
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
